/**
 * 
 */
package syshook;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author bin04017
 * 
 */
public class Syshook implements KeyboardEventListener {

	private Integer lastKey = null;

	private final Integer CTRL = 17;

	private final Integer key = 17;

	public Syshook() {
		KeyboardHook kh = new KeyboardHook();
		kh.addEventListener(this);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			br.readLine();
		} catch (IOException ex) {
			System.out.println("Error syshook");
		}
	}

	public void GlobalKeyPressed(KeyboardEvent event) {
		System.out.println("pressed");
		System.out.println(event.getSource().toString());
		if (key == 'S' && lastKey == CTRL) {
			System.out.println(";work();");
		}
		lastKey = key;
	}

	public void GlobalKeyReleased(KeyboardEvent event) {
		// TODO Auto-generated method stub

	}
}
